package jcore.basic;

public class JVMMemory {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		long max = Runtime.getRuntime().maxMemory(); //最大可用内存，对应-Xmx

		long free = Runtime.getRuntime().freeMemory(); //当前JVM空闲内存

		long total = Runtime.getRuntime().totalMemory(); //当前JVM占用的内存总数，其值相当于当前JVM已使用的内存及freeMemory()的总和

		System.out.println("max: "+max+" free: "+free+" total: "+total);
	}

}
